<template>
    <div class="budgetDeclaration-toExamine-fullmodal">
        <div>
            <!-- <div style="text-align: right;">
                <a-button
                    v-if="isRightBtn && isCw"
                    class="green-l-btn"
                    @click="toggleRightPanel" style="">
                    {{ isRightPanelVisible ? '操作记录-收起' : '操作记录-展开' }}
                </a-button>
            </div> -->
            <div class="container" :style="{ display: isRightPanelVisible ? 'flex' : 'block',height: heightType == 'modal'?'calc(100vh - 315px)':'calc(100vh - 180px)', }">
                <div class="left-panel budgetDeclaration-toExamine-div-box" :style="{ flex: isRightPanelVisible ? '1' : '1 1 100%' }">
                    <a-spin :spinning="spinning">
                        <a-collapse v-model:activeKey="collapseActiveKeyArr" class="tabs-collapse-box" style="width: 90%;margin: 0 auto;">
                            <a-collapse-panel key="1" header="审评">
                                <table :key="jcTableKey" border="1" cellspacing="0" class="table-Lu colour-table" style="width: 95%;">
                                    <tr>
                                        <th colspan="2" rowspan="3">科室</th>
                                        <th rowspan="3">项目</th>
                                        <th colspan="9">差旅费</th>
                                        <th colspan="4" rowspan="2">劳务费</th>
                                    </tr>
                                    <tr>
                                        <th colspan="4">差旅补助</th>
                                        <th colspan="2">住宿费</th>
                                        <th colspan="2">交通费</th>
                                        <th rowspan="2">合计</th>
                                    </tr>
                                    <tr>
                                        <th>企业数/组数</th>
                                        <th>人数</th>
                                        <th>天数</th>
                                        <th>小计</th>
                                        <th>住宿天数</th>
                                        <th>小计</th>
                                        <th>交通天数</th>
                                        <th>小计</th>
                                        <th>审评天数</th>
                                        <th>人次</th>
                                        <th>标准</th>
                                        <th>小计</th>
                                    </tr>
                                    <template v-for="(item,index) in financeList">
                                        <template v-if="item.list[0] && item.list[0].name">
                                            <template v-for="(itema,indexa) in item.list">
                                                <tr v-for="(itemc,indexc) in itema.list">
                                                    <th :rowspan="totalListLength(item.list) + 3" v-if="indexa == 0 && indexc == 0">{{ item.name }}</th>
                                                    <th :rowspan="itema.list.length" v-if="indexc == 0">{{ itema.name }}</th>
                                                    <td>{{ itemc.fxmmc }}</td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.fclbzqyszs"
                                                            @blur="editYssbhj({ fclbzqyszs: itemc.fclbzqyszs,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.fclbzqyszs }}</span>
                                                    </td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.fclbzrs"
                                                            @blur="editYssbhj({ fclbzrs: itemc.fclbzrs,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.fclbzrs }}</span>
                                                    </td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.fclbzts"
                                                            @blur="editYssbhj({ fclbzts: itemc.fclbzts,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.fclbzts }}</span>
                                                    </td>
                                                    <td>{{ itemc.fclbzxj }}</td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.fzxfts"
                                                            @blur="editYssbhj({ fzxfts: itemc.fzxfts,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.fzxfts }}</span>
                                                    </td>
                                                    <td>{{ itemc.fzxfxj }}</td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.fjtfts"
                                                            @blur="editYssbhj({ fjtfts: itemc.fjtfts,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.fjtfts }}</span>
                                                    </td>
                                                    <td>{{ itemc.fjtfxj }}</td>
                                                    <td>
                                                        <span>{{ itemc.fclfhjh }}</span>
                                                    </td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.flwfjcts"
                                                            @blur="editYssbhj({ flwfjcts: itemc.flwfjcts,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.flwfjcts }}</span>
                                                    </td>
                                                    <td>
                                                        <a-input-number
                                                            v-if="!isView"
                                                            v-model="itemc.flwfrc"
                                                            @blur="editYssbhj({ flwfrc: itemc.flwfrc,id: itemc.id,fxmnrid: itemc.fxmnrid },'1')"
                                                            :min="0"/>
                                                        <span v-else>{{ itemc.flwfrc }}</span>
                                                    </td>
                                                    <td>{{ itemc.flwfbz }}</td>
                                                    <td> {{ itemc.flwfxj }}</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="10">小计</td>
                                                    <td>{{ getAmountData('审评',item.name,'clf',itema.name) }}</td>
                                                    <td colspan="3">小计</td>
                                                    <td>{{ getAmountData('审评',item.name,'lwf',itema.name) }}</td>
                                                </tr>
                                            </template>
                                            <tr class="tr-hj">
                                                <th colspan="10">合计</th>
                                                <td>{{ getAmountData('审评',item.name,'clf') }}</td>
                                                <th colspan="3">合计</th>
                                                <td>{{ getAmountData('审评',item.name,'lwf') }}</td>
                                            </tr>
                                        </template>
                                        <template v-if="item.list[0] && !item.list[0].name && item.list[0].id">
                                            <tr v-for="(itemb,indexb) in item.list" :key="'indexb' + indexb">
                                                <th :rowspan="item.list.length + 1" colspan="2" v-if="indexb == 0">{{ item.name }}</th>
                                                <td>{{ itemb.fxmmc }}</td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.fclbzqyszs"
                                                        @blur="editYssbhj({ fclbzqyszs: itemb.fclbzqyszs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.fclbzqyszs }}</span>
                                                </td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.fclbzrs"
                                                        @blur="editYssbhj({ fclbzrs: itemb.fclbzrs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.fclbzrs }}</span>
                                                </td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.fclbzts"
                                                        @blur="editYssbhj({ fclbzts: itemb.fclbzts,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.fclbzts }}</span>
                                                </td>
                                                <td>{{ itemb.fclbzxj }}</td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.fzxfts"
                                                        @blur="editYssbhj({ fzxfts: itemb.fzxfts,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.fzxfts }}</span>
                                                </td>
                                                <td>{{ itemb.fzxfxj }}</td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.fjtfts"
                                                        @blur="editYssbhj({ fjtfts: itemb.fjtfts,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.fjtfts }}</span>
                                                </td>
                                                <td>{{ itemb.fjtfxj }}</td>
                                                <td>
                                                    <span>{{ itemb.fclfhjh }}</span>
                                                </td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.flwfjcts"
                                                        @blur="editYssbhj({ flwfjcts: itemb.flwfjcts,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.flwfjcts }}</span>
                                                </td>
                                                <td>
                                                    <a-input-number
                                                        v-if="!isView"
                                                        v-model="itemb.flwfrc"
                                                        @blur="editYssbhj({ flwfrc: itemb.flwfrc,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                        :min="0"/>
                                                    <span v-else>{{ itemb.flwfrc }}</span>
                                                </td>
                                                <td>{{ itemb.flwfbz }}</td>
                                                <td> {{ itemb.flwfxj }}</td>
                                            </tr>
                                            <tr class="tr-hj">
                                                <th colspan="9">合计</th>
                                                <td>{{ getAmountData('审评',item.name,'clf') }}</td>
                                                <th colspan="3">合计</th>
                                                <td>{{ getAmountData('审评',item.name,'lwf') }}</td>
                                            </tr>
                                        </template>
                                    </template>
                                    <tr class="tr-zj">
                                        <th colspan="11">总计</th>
                                        <td>{{ getAmountData('审评','总计','clf') }}</td>
                                        <th colspan="3">总计</th>
                                        <td>{{ getAmountData('审评','总计','lwf') }}</td>
                                    </tr>
                                </table>
                                <span slot="extra">
                                    <a-icon v-if="isView" type="printer" @click.stop="printClickYuSuanOnly('jcList',financeList)" style="color:#1ab394;font-size:18px;margin-right: 20px;"/>
                                    <a-icon v-if="isView" type="export" @click.stop="exportClickTable('审评')" style="color:#5ca3e5;font-size:18px;"/>
                                </span>
                            </a-collapse-panel>
                            <a-collapse-panel key="2" header="课题">
                                <table border="1" cellspacing="0" class="table-Lu colour-table" style="width: 95%;">
                                    <tr>
                                        <th>课题负责科室</th>
                                        <th>课题名称</th>
                                        <th>课题经费</th>
                                        <th>课题负责人</th>
                                        <th>课题委托单位/公司</th>
                                    </tr>
                                    <template v-for="(item,index) in ktList" v-if="item.list.length">
                                        <tr v-for="(itemb,indexb) in item.list" :key="'kt'+index+indexb">
                                            <th :rowspan="item.list.length + 1" v-if="indexb == 0">{{ item.name }}</th>
                                            <td>{{ itemb.fktmc }}</td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fktjf"
                                                    @blur="editYssbkt({ fktjf: itemb.fktjf,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fktjf }}</span>
                                            </td>
                                            <td>{{ itemb.fktfzr }}</td>
                                            <td>{{ itemb.fktwtdw }}</td>
                                        </tr>
                                        <tr class="tr-hj">
                                            <th>合计</th>
                                            <td>{{ getAmountData('课题',item.name,'ktjf') }}</td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                    </template>
                                    <tr class="tr-zj">
                                        <th colspan="2">总计</th>
                                        <td>{{ getAmountData('课题','总计','ktjf') }}</td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                </table>
                                <span slot="extra">
                                    <a-icon type="printer" @click.stop="printClickYuSuanOnly('ktList',ktList)" style="color:#1ab394;font-size:18px;margin-right: 20px;"/>
                                    <a-icon type="export" @click.stop="exportClickTable('课题')" style="color:#5ca3e5;font-size:18px;"/>
                                </span>
                            </a-collapse-panel>
                            <a-collapse-panel key="3" header="印刷">
                                <table border="1" cellspacing="0" class="table-Lu colour-table" style="width: 95%;">
                                    <tr>
                                        <th>科室</th>
                                        <th>印刷内容</th>
                                        <th>数量</th>
                                        <th>单价</th>
                                        <th>合计</th>
                                    </tr>
                                    <template v-for="(item,index) in ysList" v-if="item.list.length">
                                        <tr v-for="(itemb,indexb) in item.list" :key="'ys'+index+indexb">
                                            <th :rowspan="item.list.length + 1" v-if="indexb == 0">{{ item.name }}</th>
                                            <td>
                                                <a-input
                                                    v-if="!isView"
                                                    v-model="itemb.fsbmc"
                                                    placeholder=""
                                                    @blur="editYssbys({fsbmc:itemb.fsbmc,id:itemb.id})"
                                                    />
                                                <span v-else>{{ itemb.fsbmc }}</span>
                                            </td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fsbsl"
                                                    @blur="editYssbys({ fsbsl: itemb.fsbsl,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fsbsl }}</span>
                                            </td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fmbqs"
                                                    @blur="editYssbys({ fmbqs: itemb.fmbqs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fmbqs }}</span>
                                            </td>
                                            <td>{{ itemb.fyzhj }}</td>
                                        </tr>
                                        <tr class="tr-hj">
                                            <th colspan="3">合计</th>
                                            <td>{{ getAmountData('印刷',item.name,'ysf') }}</td>
                                        </tr>
                                    </template>
                                    <tr class="tr-zj">
                                        <th colspan="4">总计</th>
                                        <td>{{ getAmountData('印刷','总计','ysf') }}</td>
                                    </tr>
                                </table>
                                <span slot="extra">
                                    <a-icon type="printer" @click.stop="printClickYuSuanOnly('ysList',ysList)" style="color:#1ab394;font-size:18px;margin-right: 20px;"/>
                                    <a-icon type="export" @click.stop="exportClickTable('印刷')" style="color:#5ca3e5;font-size:18px;"/>
                                </span>
                            </a-collapse-panel>
                            <a-collapse-panel key="4" header="培训">
                                <table border="1" cellspacing="0" class="table-Lu colour-table" style="width: 95%;">
                                    <tr>
                                        <th>科室</th>
                                        <th>培训班名称</th>
                                        <th>培训人数</th>
                                        <th>培训天数</th>
                                        <th>培训费用</th>
                                        <th>学时/天</th>
                                        <th>正高学时/天</th>
                                        <th>正高费用</th>
                                        <th>副高学时/天</th>
                                        <th>副高费用</th>
                                        <th>授课费</th>
                                        <th>小计</th>
                                    </tr>
                                    <template v-for="(item,index) in pxList" v-if="item.list.length">
                                        <tr v-for="(itemb,indexb) in item.list" :key="'px'+index+indexb">
                                            <th :rowspan="item.list.length + 1" v-if="indexb == 0">{{ item.name }}</th>
                                            <td>
                                                <a-textarea
                                                    v-if="!isView"
                                                    v-model="itemb.fpxmc"
                                                    placeholder=""
                                                    @blur="editYssbpx({fpxmc:itemb.fpxmc,id:itemb.id})"
                                                    :auto-size="{ minRows: 1}"
                                                    />
                                                <span v-else>{{ itemb.fpxmc }}</span>
                                            </td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fpxrs"
                                                    @blur="editYssbpx({ fpxrs: itemb.fpxrs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fpxrs }}</span>
                                            </td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fpxts"
                                                    @blur="editYssbpx({ fpxts: itemb.fpxts,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fpxts }}</span>
                                            </td>
                                            <td>{{ itemb.fpxfy }}</td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fxst"
                                                    @blur="editYssbpx({ fxst: itemb.fxst,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fxst }}</span>
                                            </td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.fzgxs"
                                                    @blur="editYssbpx({ fzgxs: itemb.fzgxs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.fzgxs }}</span>
                                            </td>
                                            <td>{{ itemb.fzgfy }}</td>
                                            <td>
                                                <a-input-number
                                                    v-if="!isView"
                                                    v-model="itemb.ffgxs"
                                                    @blur="editYssbpx({ ffgxs: itemb.ffgxs,id: itemb.id,fxmnrid: itemb.fxmnrid },'1')"
                                                    :min="0"/>
                                                <span v-else>{{ itemb.ffgxs }}</span>
                                            </td>
                                            <td>{{ itemb.ffgfy }}</td>
                                            <td>{{ itemb.fskf }}</td>
                                            <td>{{ itemb.fpxskxj }}</td>
                                        </tr>
                                        <tr class="tr-hj">
                                            <th>合计</th>
                                            <td>{{ getAmountData('培训',item.name,'pxrs') }}</td>
                                            <td></td>
                                            <td>{{ getAmountData('培训',item.name,'pxf') }}</td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td>{{ getAmountData('培训',item.name,'szfy') }}</td>
                                            <td>{{ getAmountData('培训',item.name,'pxhj') }}</td>
                                        </tr>
                                    </template>
                                    <tr class="tr-zj">
                                        <th colspan="2">总计</th>
                                        <td>{{ getAmountData('培训','总计','pxrs') }}</td>
                                        <td></td>
                                        <td>{{ getAmountData('培训','总计','pxf') }}</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td>{{ getAmountData('培训','总计','szfy') }}</td>
                                        <td>{{ getAmountData('培训','总计','pxhj') }}</td>
                                    </tr>
                                </table>
                                <span slot="extra">
                                    <a-icon type="printer" @click.stop="printClickYuSuanOnly('pxList',pxList)" style="color:#1ab394;font-size:18px;margin-right: 20px;"/>
                                    <a-icon type="export" @click.stop="exportClickTable('培训')" style="color:#5ca3e5;font-size:18px;"/>
                                </span>
                            </a-collapse-panel>
                            <a-collapse-panel key="5" header="绩效指标">
                                <table border="1" cellspacing="0" class="table-Lu color-Table-jiXiao" style="width: 90%;">
                                    <tr>
                                        <th>科室</th>
                                        <th>绩效指标类型</th>
                                        <th>一级指标</th>
                                        <th>二级指标</th>
                                        <th>三级指标</th>
                                        <th>指标值</th>
                                    </tr>
                                    <tr v-if="jxList.length == 0">
                                        <td colspan="6">暂无数据</td>
                                    </tr>
                                    <template v-for="(itema,indexa) in jxList">
                                    <template v-for="(itemb,indexb) in itema.jxzbmcList">
                                        <template v-for="(itemc,indexc) in itemb.lxList">
                                            <template v-for="(itemd,indexd) in itemc.lxmcDataList">
                                                <template v-for="(itemf,indexf) in itemd.zbDataList">
                                                    <tr>
                                                        <!-- :rowspan="itema.size" v-if="indexc == 0 && indexd == 0 && indexf == 0" -->
                                                        <td class="td-itema" :rowspan="itema.size" v-if="(indexb == itema.index ) && indexc == 0 && indexd == 0 && indexf == 0">{{ itema.ksmc }}</td>
                                                        <td class="td-itemb" :rowspan="itemb.size" v-if="(indexc == itemb.index ) && indexd == 0 && indexf == 0">{{ itemb.fjssblx }}</td>
                                                        <td class="td-itemc1" :rowspan="itemc.size" v-if="indexd == 0 && indexf == 0 && (itemc.lxmc == '产出指标')">{{ itemc.lxmc }}</td>
                                                        <td class="td-itemc2" :rowspan="itemc.size" v-if="indexd == 0 && indexf == 0 && (itemc.lxmc == '效益指标')">{{ itemc.lxmc }}</td>
                                                        <td class="td-itemc3" :rowspan="itemc.size" v-if="indexd == 0 && indexf == 0 && (itemc.lxmc == '满意度指标')">{{ itemc.lxmc }}</td>
                                                        <td class="td-itemd" :rowspan="itemd.zbDataList.length" v-if="indexf == 0">{{ itemd.slzb }}</td>
                                                            <td>
                                                                <a-textarea
                                                                    v-if="!isView"
                                                                    v-model="itemf.key"
                                                                    placeholder=""
                                                                    @blur="editHzjxzbss({fsjzb:itemf.key,id:itemf.id})"
                                                                    :auto-size="{ minRows: 1}"
                                                                    />
                                                                <span v-else>{{ itemf.key }}</span>
                                                            </td>
                                                            <td>
                                                                <a-textarea
                                                                    v-if="!isView"
                                                                    v-model="itemf.value"
                                                                    placeholder=""
                                                                    @blur="editHzjxzbss({fzbz:itemf.value,id:itemf.id})"
                                                                    :auto-size="{ minRows: 1}"
                                                                    />
                                                                <span v-else>{{ itemf.value }}</span>
                                                            </td>
                                                        </tr>
                                                    </template>
                                                </template>
                                            </template>
                                        </template>
                                    </template>
                                </table>
                                <span slot="extra">
                                    <a-icon v-if="isView" type="printer" @click.stop="printJx()" style="color:#1ab394;font-size:18px;margin-right: 20px;"/>
                                    <a-icon v-if="isView" type="export" @click.stop="exportJx()" style="color:#5ca3e5;font-size:18px;"/>
                                </span>
                            </a-collapse-panel>
                        </a-collapse>
                    </a-spin>
                </div>
                <!-- <div class="right-panel" v-if="isRightPanelVisible && isCw">
                    <h2 class="right-panel-title">操作记录</h2>
                    <div :style="{height: heightType == 'modal'?'calc(100vh - 406px)':'calc(100vh - 270px)'}" style="overflow-y: auto;">
                        <a-list item-layout="horizontal" :data-source="operationLogList">
                            <a-list-item slot="renderItem" slot-scope="item, index">
                                <a-list-item-meta
                                    :description="item.fxgjl"
                                >
                                <a slot="title" href="#">{{ item.fxgsj + ' ' + item.fxgr}}</a>
                            </a-list-item-meta>
                            </a-list-item>
                        </a-list>
                    </div>
                </div> -->
            </div>
        </div>
        <div style="text-align: center;padding-top: 10px;">
            <a-button v-if="isCanInitiate" class="blue-btn" @click="handleOk">
                发起流程
            </a-button>
        </div>
        <a-modal
            v-model:visible="auditingVisible"
            title="审核意见填写"
            width="60%"
            wrapClassName="internalControl-reimbursement-auditingModal-form-box">
            <a-spin :spinning="tloading">
                <div style="width: 95%;margin: 0 auto;">
                    <a-form :form="cform" ref="form" class="internalControl-reimbursement-model-form-box">
                        <a-descriptions bordered style="width: 100%;" v-if="auditingVisible">
                            <a-descriptions-item :span="3" v-if="descriptionsData('办公室领导审核(一上)').hjmc && descriptionsData('办公室领导审核(一上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    办公室领导审核(一上)
                                </span>
                                <a-form-item ref="fysbgsldshyj" prop="fysbgsldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('办公室领导审核(一上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fysbgsldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fysbgsldshyj,'fysbgsldshyj')"
                                            v-decorator="[
                                                'fysbgsldshyj', {initialValue:formState.fysbgsldshyj,rules: rules.fysbgsldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fysbgsldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('办公室领导审核(一上)').url" :src="descriptionsData('办公室领导审核(一上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fysbgsldshr }}</span>
                                            <span>{{ formState.fysbgsldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('领导班子审核(一上)').hjmc && descriptionsData('领导班子审核(一上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    领导班子审核(一上)
                                </span>
                                <a-form-item ref="fyszxldshyj" prop="fyszxldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('领导班子审核(一上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fyszxldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fyszxldshyj,'fyszxldshyj')"
                                            v-decorator="[
                                                'fyszxldshyj', {initialValue:formState.fyszxldshyj,rules: rules.fyszxldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fyszxldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('领导班子审核(一上)').url" :src="descriptionsData('领导班子审核(一上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fyszxldshr }}</span>
                                            <span>{{ formState.fyszxldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('办公室领导审核(二上)').hjmc && descriptionsData('办公室领导审核(二上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    办公室领导审核(二上)
                                </span>
                                <a-form-item ref="fesbgsldshyj" prop="fesbgsldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('办公室领导审核(二上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fesbgsldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fesbgsldshyj,'fesbgsldshyj')"
                                            v-decorator="[
                                                'fesbgsldshyj', {initialValue:formState.fesbgsldshyj,rules: rules.fesbgsldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fesbgsldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('办公室领导审核(二上)').url" :src="descriptionsData('办公室领导审核(二上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fesbgsldshr }}</span>
                                            <span>{{ formState.fesbgsldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('领导班子审核(二上)').hjmc && descriptionsData('领导班子审核(二上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    领导班子审核(二上)
                                </span>
                                <a-form-item ref="feszxldshyj" prop="feszxldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('领导班子审核(二上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'feszxldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.feszxldshyj,'feszxldshyj')"
                                            v-decorator="[
                                                'feszxldshyj', {initialValue:formState.feszxldshyj,rules: rules.feszxldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.feszxldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('领导班子审核(二上)').url" :src="descriptionsData('领导班子审核(二上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.feszxldshyjsj }}</span>
                                            <span>{{ formState.feszxldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                        </a-descriptions>
                    </a-form>
                </div>
            </a-spin>
            <template slot="footer">
                <a-button @click="saveClick()">保存</a-button>
                <a-button class="blue-btn" type="primary" @click="submitClick()">提交并关闭</a-button>
                <a-button class="red-btn" type="primary" @click="returnClick()">退回</a-button>
            </template>
        </a-modal>
        <printModal ref="printModalRef" />
    </div>
</template>

<script>
import { axios } from '@/utils/request'
import YchConstant from "@/api/YchConstant";
import {
    yssbHzbd,
    yssbEditYs,
    yssbFirstJs,
    yssbHyjlList,
    yssbDehyjl,
    yssbInitBzFlow,
    pidgetlchj,
    getMoreUserSignLinkList,
    yssbSaveFlow,
    yssbSubmitFlow,
    yssbSfcw,
    yssbGetjhid,
    yssbKthzbd,
    yssbYshzbd,
    yssbPxhzbd,
    yssbEditYskt,
    yssbEditYsys,
    yssbEditYspx,
    yssbHzjxzbss,
    yssbEditYssbjxbz,
    exportRealTimeJxzb,
} from './service/index'
import transferRecords from '@/views/administrativeOffice-new/modal/transferRecords'
import assessCheckApi from './service/api.js'
import store from '@/store'
import printModal from '../modal/print'
export default {
    components: {
        transferRecords,
        printModal,
    },
    data() {
        return {
            modalTitle: '',
            isRightBtn: false,
            isRightPanelVisible: true, // 控制右边面板是否显示
            spinning: false,
            heightType: '',
            financeList: [],
            amountData: [],
            rawData: {},
            operationLogList: [],
            isView: true,
            formState: {},
            linkName: '',
            linkList: [
                {
                    name: '财务审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '办公室领导审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '领导班子审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '财务审核(二上)',
                    flx: '财务审核(二上)'
                },{
                    name: '办公室领导审核(二上)',
                    flx: '财务审核(二上)'
                },{
                    name: '领导班子审核(二上)',
                    flx: '财务审核(二上)'
                },
            ],
            displayList: [],
            cform:this.$form.createForm(this, { name: 'cform' }),
            auditingVisible: false,
            tloading: false,
            rules:{
                fysbgsldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                fyszxldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                fesbgsldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                feszxldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
            },
            isOpintion: true,
            isCw: false,
            isCanInitiate: false,
            collapseActiveKeyArr:['1','2','3','4','5'],
            ktList: [],
            ysList: [],
            pxList: [],
            jcTableKey: null,
            jxList: [],
            exportData: [
                {
                    type: '审评',
                    fileName: '预算申报汇总表单-审评',
                    url: YchConstant.SPZX_OA + '/exceldc/generateExcellwcl',
                },{
                    type: '课题',
                    fileName: '预算申报汇总表单-课题',
                    url: YchConstant.SPZX_OA + '/exceldc/generateExcelkt',
                },{
                    type: '印刷',
                    fileName: '预算申报汇总表单-印刷',
                    url: YchConstant.SPZX_OA + '/exceldc/generateExcelys',
                },{
                    type: '培训',
                    fileName: '预算申报汇总表单-培训',
                    url: YchConstant.SPZX_OA + '/exceldc/generateExcelpx',
                },
            ],

        };
    },
    methods: {
        // 是否财务
        getYssbSfcw(){
            yssbSfcw().then(res => {
                if(res.success && res.result){
                    this.isCw = res.result
                    //console.log('HHHHHHHHHHHHHHH',store.getters.userInfo.orgName)
                }
            })
        },
        async getWriteData(val,heightType,isview){
            this.getYssbSfcw()
            this.heightType = heightType
            this.isRightBtn = true
            this.rawData = val
            let resA = await yssbGetjhid()

            if(resA.success){
                this.rawData = {
                    ...val,
                    bm: (this.isCw || heightType)?'':store.getters.userInfo.orgName,
                    jhid: resA.result.jhid,
                }
                this.linkName = resA.result.hjmc

                if((this.linkName ==  this.rawData.flx) && this.isCw ){
                    this.isView = false
                    // this.isCanInitiate = true
                } else {
                    this.isView = true
                    // this.isCanInitiate = false
                }
                if(isview){
                    this.isView = true
                    this.isRightBtn = false
                    this.isRightPanelVisible = false
                }
                let resB = await pidgetlchj({ pid: this.rawData.jhid })
                if(resB.result.length == 1 && this.rawData.flx == '财务审核(一上)' && this.isCw){
                    this.isCanInitiate = true
                } else {
                    this.isCanInitiate = false
                }
                // this.getyssbHyjlList(this.rawData) // 操作记录
                this.getyssbGetYs(this.rawData,'1') // 获取汇总数据
                this.getyssbKthzbd(this.rawData,'1') // 课题汇总
                this.getyssbYshzbd(this.rawData,'1') // 印刷
                this.getyssbPxhzbd(this.rawData,'1') //培训
                this.getyssbHzjxzbss(this.rawData,'1') // 绩效

            } else {
                this.$message.error(resA.message)
            }

        },
        getData(val1,val2,heightType){
            this.getYssbSfcw()
            this.heightType = heightType
            this.visible = true
            //console.log('没进来吗？？？',val1,val2)

            this.linkName = val1.hjmc
            // let arrItem = this.linkList.filter(item => item.name == this.linkName)
            // this.rawData = {
            //     flx: arrItem[0].flx,
            //     jhid: val1.oaMap.id,
            // }
            if(this.linkName=='财务审核(一上)' || this.linkName == '财务审核(二上)'){
                this.isView = false
                this.isRightBtn = true
                this.isRightPanelVisible = true
            } else {
                this.isView = true
                this.isRightBtn = false
                this.isRightPanelVisible = false
                this.isCanInitiate = false
            }
            this.modalTitle = this.linkName=='我的已办'?'预算申报计划-查看':this.linkName
            this.isOpintion = this.linkName=='我的已办'?false:true
            this.formState = val1.oaMap
            this.formState.jobid = val1.jobMap?val1.jobMap.id:''

            this.getDisplayList(this.formState.id,heightType)
        },
        getyssbGetYs(val,val1){
            yssbHzbd({...val}).then(res => {
                if(res.success){
                    this.financeList = res.result
                    if(val1){
                        this.editYssbhj({id:''})
                    }
                    //  else {
                    //     this.getyssbFirstJs({jclx: '审评'})
                    // }
                }
            })
        },
        getyssbKthzbd(val,val1){
            yssbKthzbd({...val}).then(res => {
                if(res.success){
                    this.ktList = res.result
                    //console.log('this.ktList', this.ktList)
                    if(val1){
                        this.editYssbkt({id:''})
                    }
                    // this.getyssbFirstJs({jclx: '课题'})
                }
            })
        },
        getyssbYshzbd(val,val1){
            yssbYshzbd({...val}).then(res => {
                if(res.success){
                    this.ysList = res.result
                    if(val1){
                        this.editYssbys({id:''})
                    }
                    // this.getyssbFirstJs({jclx: '印刷'})
                }
            })
        },
        getyssbPxhzbd(val,val1){
            yssbPxhzbd({...val}).then(res => {
                if(res.success){
                    this.pxList = res.result
                    if(val1){
                        this.editYssbpx({id:''})
                    }
                    // this.getyssbFirstJs({jclx: '培训'})
                }
            })
        },
        // 绩效
        getyssbHzjxzbss(val,val1){
            yssbHzjxzbss({...val}).then(res => {
                if(res.success){
                    this.jxList = res.result
                }
            })
        },
        editHzjxzbss(val){
            yssbEditYssbjxbz({ ...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx }).then(res => {
                if(res.success){
                    this.jxList = res.result
                    // this.getyssbHzjxzbss(this.rawData)
                    // this.getyssbHyjlList(this.rawData)
                    this.$message.success(res.message)
                } else {
                    this.$message.error(res.message)
                }
            })
        },
        getDisplayList(ids,val){
            pidgetlchj({pid: ids}).then((res) => {
                let arr1 = res.result
                this.displayList = []
                this.displayList = res.result

                let arrItem = arr1.filter(item => item.hjmc == '财务审核(二上)')
                //console.log('MMMMMMMMMM',arrItem)
                this.rawData = {
                    ...this.rawData,
                    bm: (this.isCw || val)?'':store.getters.userInfo.orgName,
                    jhid: this.formState.id?this.formState.id:this.rawData.jhid,
                    flx: arrItem.length?arrItem[0].hjmc:'财务审核(一上)'
                }
                //console.log('OOOOOOOOOOOOOOOOOOO',this.isRightBtn,this.isCw,this.rawData)
                // this.getyssbHyjlList(this.rawData) // 操作记录
                this.getyssbGetYs(this.rawData,'1') // 获取汇总数据
                this.getyssbKthzbd(this.rawData,'1') // 课题汇总
                this.getyssbYshzbd(this.rawData,'1') // 印刷
                this.getyssbPxhzbd(this.rawData,'1') //培训
                this.getyssbHzjxzbss(this.rawData,'1') // 绩效

                // this.getyssbGetYs(this.rawData,'1')


                this.displayList.forEach(async (item,index) => {
                    if(item.blrid && item.blzt!=='待办'){
                        let resa = await getMoreUserSignLinkList({ids:item.blrid})
                        if(resa.success && resa.result.length){
                            if(resa.result[0].signLink == ''){
                                this.displayList[index] = {
                                    ...item,
                                    url: null
                                }
                            } else {
                                this.displayList[index] = {
                                    ...item,
                                    url: resa.result[0].signLink+'&aa='+Date.now()
                                }
                            }
                        } else {
                            this.displayList[index] = {
                                ...item,
                                url: null
                            }
                        }
                    } else {}
                })
                //console.log('最终获得的签名图片列表---',this.displayList)
            })
        },
        descriptionsData(hjmc){
            let data = {}
            this.displayList.forEach(item => {
                // //console.log('descriptionsData000',hjmc,item)
                if(item.hjmc == hjmc){
                    data = {...item}
                }
            })
            // //console.log('descriptionsData',data)
            return data
        },
        opinions(val1,val2,val3){
            //console.log(val1,val2,val3)
            this.$refs[`reviewOpinionsRef${val3}`].getData({opinionType:val1,oldVal:val2,valueData:{hjmc:val3}})
        },
        getInputOpinion(val,valueData){
            //console.log('--------',val,valueData)
            let data = this.formState
            data[valueData.hjmc] = val
            this.cform.setFieldsValue({
                fysbgsldshyj: this.formState.fysbgsldshyj,
                fyszxldshyj: this.formState.fyszxldshyj,
                fesbgsldshyj: this.formState.fesbgsldshyj,
                feszxldshyj: this.formState.feszxldshyj,
            });
        },
        closeVisible() {
            if(this.isView == true){
                this.visible = false
            } else {
                let that = this
                this.$confirm({
                    title:'当前页面关闭前，是否保存当前操作记录？',
                    okText: '确认保存',
                    cancelText: '取消保存',
                    onOk() {
                        yssbDehyjl({jhid: that.rawData.jhid,sfbc: '是'}).then(res => {
                            if(res.success){
                                that.$message.success('已保存当前操作记录')
                                that.visible = false
                            }
                        })
                    },
                    onCancel() {
                        yssbDehyjl({jhid: that.rawData.jhid,sfbc: '否'}).then(res => {
                            if(res.success){
                                that.$message.success('已取消保存当前操作记录')
                                that.visible = false
                            }
                        })
                    },
                })
            }
        },
        toggleRightPanel() {
            this.isRightPanelVisible = !this.isRightPanelVisible;
        },
        // 返回药品注册的分类下的总条数
        totalListLength(Item){
            //console.log('************',Item.reduce((total, item) => total + item.list.length, 0))
            return Item.reduce((total, item) => total + item.list.length, 0);
        },
        calculateZbDataListLength(items) {
            let sum = 0
            if(items.length > 0){
                items.forEach(item => {
                    if (item.zbDataList) {
                        sum = sum + item.zbDataList.length;
                    }
                    if (!item.zbDataList) {
                        this.calculateZbDataListLength(item);
                    }
                })
            }
            //console.log('lengths============',sum)
            return sum;
        },
        // 进入首次获取合计
        getyssbFirstJs(val){
            yssbFirstJs({jhid: this.rawData.jhid,...val}).then(res => {
                if(res.success){
                    this.amountData.push({...val,list:[...res.result]})

                    // let index = this.amountData.findIndex(item => item.jclx === val.jclx);
                    // if (index !== -1) {
                    //     this.amountData[index].list = res.result;
                    // } else {
                    //     this.amountData.push({...val,list:[...res.result]})
                    // }
                    //console.log('this.amountData',this.amountData)
                }
            })
        },
        // 操作记录
        getyssbHyjlList(val){
            //console.log('??????????????',val)
            yssbHyjlList({...val}).then(res => {
                if(res.success){
                    this.operationLogList = res.result
                }
            })
        },
        // 编辑-审评
        editYssbhj(val,val1){
            // let arrItem = this.linkList.filter(item => item.name == this.linkName)
            yssbEditYs({...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx}).then(res => {
                if(res.success){
                    // this.amountData = res.result
                    let index = this.amountData.findIndex(item => item.jclx === '审评');
                    if (index !== -1) {
                        this.amountData[index].list = res.result;
                    } else {
                        this.amountData.push({jclx: '审评',list:[...res.result]})
                    }
                    //console.log('this.amountData',this.amountData)
                    if(val1){
                        this.getyssbGetYs(this.rawData)
                        // this.getyssbHyjlList(this.rawData)
                        this.$message.success(res.message)
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        // 编辑-课题
        editYssbkt(val,val1){
            yssbEditYskt({...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx}).then(res => {
                if(res.success){
                    // this.amountData = res.result
                    let index = this.amountData.findIndex(item => item.jclx === '课题');
                    if (index !== -1) {
                        this.amountData[index].list = res.result;
                    } else {
                        this.amountData.push({jclx: '课题',list:[...res.result]})
                    }
                    if(val1){
                        this.getyssbKthzbd(this.rawData)
                        // this.getyssbHyjlList(this.rawData)
                        this.$message.success(res.message)
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        // 编辑-印刷
        editYssbys(val,val1){
            yssbEditYsys({...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx}).then(res => {
                if(res.success){
                    // this.amountData = res.result
                    let index = this.amountData.findIndex(item => item.jclx === '印刷');
                    if (index !== -1) {
                        this.amountData[index].list = res.result;
                    } else {
                        this.amountData.push({jclx: '印刷',list:[...res.result]})
                    }
                    if(val1){
                        this.getyssbYshzbd(this.rawData)
                        // this.getyssbHyjlList(this.rawData)
                        this.$message.success(res.message)
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        // 编辑-培训
        editYssbpx(val,val1){
            yssbEditYspx({...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx}).then(res => {
                if(res.success){
                    // this.amountData = res.result
                    let index = this.amountData.findIndex(item => item.jclx === '培训');
                    if (index !== -1) {
                        this.amountData[index].list = res.result;
                    } else {
                        this.amountData.push({jclx: '培训',list:[...res.result]})
                    }
                    if(val1){
                        this.getyssbPxhzbd(this.rawData)
                        // this.getyssbHyjlList(this.rawData)
                        this.$message.success(res.message)
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        // 返回合计
        getAmountData(jclx,Item,type,childType){
            if(this.amountData.length == 4){
                // //console.log('11111111111',jclx,this.amountData)
                const itemArrA = this.amountData.filter(item => item.jclx == jclx)
                // //console.log('2222222222222',itemArrA)
                const itemArr = itemArrA[0].list.filter(item => item.name == Item)
                if(childType){
                    var itemArr1 = itemArr[0].list.filter(item => item.name == childType)
                    return itemArr1[0][type]
                }
                // //console.log('itemArr4',itemArr,itemArr1)
                if(!itemArr[0][type]){
                    return 0
                }
                return itemArr[0][type]
            }
        },
        handleOk(){
            let that = this
            this.$confirm({
                title:'您确认全部数据已修改完毕，要发起审核流程吗？',
                onOk() {
                    let data = {
                        id: that.rawData.jhid,
                        fsffqlc: '是',
                    }
                    yssbInitBzFlow(data).then(res => {
                        if(res.success){
                            that.$message.success('已发起审核流程')
                            that.isView = true
                            that.isCanInitiate = true
                            // that.isRightPanelVisible = false
                            that.getWriteData(that.rawData)
                        }
                    })
                }
            })
        },
        saveClick(){
            this.bloading = true
            let data = {
                jobid: this.formState.jobid,
                map: {},
                oaid: this.formState.id,
                opinion: "",
            }
            if(this.linkName == '办公室领导审核(一上)'){
                data.opinion = this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                data.map = {
                    fysbgsldshyj: this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                }
            } else if(this.linkName == '领导班子审核(一上)'){
                data.opinion = this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                data.map = {
                    fyszxldshyj: this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                }
            } else if (this.linkName == '办公室领导审核(二上)'){
                data.opinion = this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:''
                data.map = {
                    fesbgsldshyj: this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:'',
                }
            } else if (this.linkName == '领导班子审核(二上)'){
                data.opinion = this.formState.feszxldshyj?this.formState.feszxldshyj:''
                data.map = {
                    feszxldshyj: this.formState.feszxldshyj?this.formState.feszxldshyj:''
                }
            }
            yssbSaveFlow(data).then(res => {
                if(res.success){
                    this.$message.success(res.message)
                } else {
                    this.$message.warning(res.message)
                }
                this.bloading = false
            })
        },
        submitClick(){
            //console.log(this.formState)
            this.cform.validateFields((err, values) => {
                if (!err) {
                    let data = {
                        jobid: this.formState.jobid,
                        map: {},
                        oaid: this.formState.id,
                        opinion: "",
                    }
                    if(this.linkName == '办公室领导审核(一上)'){
                        data.opinion = this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                        data.map = {
                            fysbgsldshyj: this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                        }
                    } else if(this.linkName == '领导班子审核(一上)'){
                        data.opinion = this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                        data.map = {
                            fyszxldshyj: this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                        }
                    } else if(this.linkName == '财务审核(二上)'){
                        data.opinion = '同意'
                        data.map = {
                            fescwshyj: '同意'
                        }
                    } else if (this.linkName == '办公室领导审核(二上)'){
                        data.opinion = this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:''
                        data.map = {
                            fesbgsldshyj: this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:'',
                        }
                    } else if (this.linkName == '领导班子审核(二上)'){
                        data.opinion = this.formState.feszxldshyj?this.formState.feszxldshyj:''
                        data.map = {
                            feszxldshyj: this.formState.feszxldshyj?this.formState.feszxldshyj:''
                        }
                    }
                    var that = this
                    that.$confirm({
                        title: '您确定要提交吗?',
                        onOk() {
                            that.tloading = true
                            yssbSubmitFlow(data).then(res => {
                                if(res.success){
                                    that.$message.success(res.message)
                                    that.$emit('success')
                                    that.auditingVisible = false
                                    that.visible = false
                                } else {
                                    that.$message.warning(res.message)
                                }
                                that.tloading = false
                            })
                        },
                        onCancel() {},
                    })
                }
            })
        },
        returnClick(){
            this.cform.validateFields((err, values) => {
                if (!err) {
                    var that = this
                    that.$confirm({
                        title: '您确定要退回吗?',
                        onOk() {
                            // that.spinning = true
                            //console.log('历史列表',that.jobHistoryList)
                            let slist = {}
                            if(that.linkName == '财务审核'){
                                slist = that.jobHistoryList.filter(item => item.fhjmc == '填写报销单')
                            }
                            if(that.linkName == '出纳审核'){
                                slist = that.jobHistoryList.filter(item => item.fhjmc == '财务审核')
                            }
                            //console.log(slist)
                            let ids = slist[0].id
                            // that.returnFuntion(that.formState.jobid,sortedDates[slist.length - 1].id)
                            // let slist = list.filter(item => item.fhjmc == '起草')
                            // const sortedDates = slist.sort((a, b) => new Date(b) - new Date(a));
                            that.returnFuntion(that.formState.jobid,ids)
                        },
                        onCancel() {},
                    });
                }
            })
        },
        returnFuntion(jobid,ids){
            let returnStr = ''
            if(this.linkName == '财务审核'){
                returnStr = this.formState.fesbgsldshyj
            } else if(this.linkName == '出纳审核'){
                returnStr = '不同意'
            }
            let data = {
                jobid: jobid,
                opinion: returnStr,
                shjid: ids,
            }
            this.tloading = true
            returnUpperzdyFlowJob(data).then(res => {
                if(res.code == 200){
                    this.$emit('success')
                    this.$message.success(res.message)
                    this.auditingVisible = false
                    this.visible = false
                } else {
                    this.$message.error(res.message)
                }
                this.tloading = false
            })
        },
        // 打印、导出
        printClickYuSuanOnly(valName,val){
            let yuSuanData = {
                jcList:[],
                ktList: [],
                ysList: [],
                pxList: [],
            }
            yuSuanData[valName] = val
            this.$refs.printModalRef.getData(false,{val1:yuSuanData},true)
        },
        exportClickTable(type){
            let list = this.exportData[this.exportData.findIndex(item => item.type == type)]
            //console.log('list',list)
            var fileName = list.fileName + '('+ this.rawData.flx + ')'
            var item = {
                jhid: this.rawData.jhid,
                flx: this.rawData.flx,
            }
            axios({
                url: list.url,
                method:'get' ,
                params: {...item},
                url_2:'outside',
                responseType: 'blob'
            }).then((data)=>{
                if (!data) {
                    that.$message.warning('文件下载失败')
                    return
                }
                if (typeof window.navigator.msSaveBlob !== 'undefined') {
                    window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
                } else {
                    let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
                    let link = document.createElement('a')
                    link.style.display = 'none'
                    link.href = url
                    link.setAttribute('download', fileName + '.xls')
                    document.body.appendChild(link)
                    link.click()
                    document.body.removeChild(link) //下载完成移除元素
                    window.URL.revokeObjectURL(url) //释放掉blob对象
                }
            })
        },
        printJx(){
            this.$refs.printModalRef.getData(false,{val2:this.jxList})
        },
        exportJx(){
            var item = {
                jhid: this.rawData.jhid,
                flx: this.rawData.flx,
            }
            var fileName = '预算申报绩效指标汇总表单' + '('+ this.rawData.flx + ')'
            exportRealTimeJxzb(item).then((data)=>{
                if (!data) {
                    that.$message.warning('文件下载失败')
                    return
                }
                if (typeof window.navigator.msSaveBlob !== 'undefined') {
                    window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
                } else {
                    let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
                    let link = document.createElement('a')
                    link.style.display = 'none'
                    link.href = url
                    link.setAttribute('download', fileName + '.xls')
                    document.body.appendChild(link)
                    link.click()
                    document.body.removeChild(link) //下载完成移除元素
                    window.URL.revokeObjectURL(url) //释放掉blob对象
                }
            })
        },
    },
};
</script>

<style lang="less">
.budgetDeclaration-toExamine-fullmodal {
    height: 100%;
    .ant-modal {
        background-color: #5ca3e5;
        position: static;
        width: 100%;
        height: 100%;
        top: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 auto !important;
    }
    .ant-modal-content {
        height: 100%;
    }
    .ant-modal-body {
        padding: 15px !important;
        background-color: white;
        overflow-y: auto;
        height: calc(100vh - 108px) !important;
    }
    .ant-modal-wrap {
        background-color: white;
    }
    .ant-list-empty-text {
        padding: 0px !important;
    }
    .ant-empty-normal {
        margin: 0px !important;
    }
    .budgetDeclaration-toExamine-div-box {
        .table-Lu{
            // width: 794px;
            margin: 0 auto;
            // margin-top: 4mm;
            font-size: 16px;
            table-layout: fixed;
            th {
                font-family: 'SimSun', serif;
                text-align: center;
                font-size: 18px;
                font-weight: bold !important;
                line-height: 2.5;
                padding: 0px;
                color: black;
            }
            td {
                font-family: 'SimSun', serif;
                min-width: 150px;
                text-align: center;
                line-height: 1.5;
                padding: 5px 0px;
                font-size: 18px;
                min-height: 46px !important;
                height: 46px;
                color: black;
                word-wrap:break-word;
                word-break:break-all;
                white-space:normal;
                .ant-form-item {
                    margin-bottom: 0px;
                }
            }
            .ant-input {
                width: 90% !important;
                border: 1px solid dodgerblue !important;
            }
            .ant-input-number {
                width: 90% !important;
                border: 1px solid dodgerblue !important;
            }
        }
        .colour-table {
            th {
                background-color: #bcd4ec !important;
            }
            tr:nth-child(odd){
                background-color: #eef5fb;
            }
            .tr-hj {
                th {
                    background-color: #e7ecd6 !important;
                }
                td {
                    background-color: #e7ecd6 !important;
                }
            }
            .tr-zj {
                th {
                    background-color: #cef1d3 !important;
                }
                td {
                    background-color: #cef1d3 !important;
                }
            }
        }
        .color-Table-jiXiao {
            tr:nth-child(odd){
                background-color: #eef5fb;
            }
            th, .td-itema {
                background-color: #7facd6 !important;
            }
            .td-itemb {
                background-color: #ffffff !important;
            }
            .td-itemc1 {
                background-color: #bcd4ec !important;
            }
            .td-itemc2 {
                background-color: #bfbbda !important;
            }
            .td-itemc3 {
                background-color: #e8b7d4 !important;
            }
            .td-itemd {}
        }
        .internalControl-reimbursement-model-form-box {
            padding: 0 15px;
            margin-top: 20px;
            .ant-descriptions-bordered .ant-descriptions-item-label{
                font-weight: 600;
                color: rgba(0, 0, 0, 0.85);
                background-color:#e6f7ff;
                width: 150px !important;
                text-align: center;
                font-size: 16px;
                font-family:simHei !important;
            }
            .ant-descriptions-bordered .ant-descriptions-item-label, .ant-descriptions-bordered .ant-descriptions-item-content{
                padding: 5px 10px !important;
                .ant-form-item {
                    margin-bottom: 0 !important;
                }

            }
            .descriptions-row .descriptions-label-slot{
                display: flex;
                align-items: center;
                width: 120px !important;//确保左侧固定文字不会换行
                justify-content: center;
                text-align: center;
            }
            .xhText{
                color: #f5222d;
                line-height: 31px;
                font-size: 14px;
                font-weight: 600;
                height: 30px;
            }
            .descriptions-item-center{

            }
            .ant-form-inline .ant-form-item-with-help{
                margin-bottom: 0px !important;
            }
            .zm-form-model{
                display: flex;
                .ant-form-item-control-wrapper{
                    flex: 1;
                }
            }
            .ant-descriptions-bordered .ant-descriptions-row{
                border-bottom: 1px solid #e4e3e3;
            }
            .ant-descriptions-bordered .ant-descriptions-item-label, .ant-descriptions-bordered .ant-descriptions-item-content{
                border-right: 1px solid #e4e3e3;
                min-width: 100px;
            }
            .ant-descriptions-bordered .ant-descriptions-view{
                border: 1px solid #e4e3e3;
                border-right: 0;
            }
            .ant-descriptions-row:last-child{
                border-bottom: 0;
            }

        }
        .yjqm-right-bottom {
            text-align: right;
            margin-right: 20px;
            margin-bottom: 10px;
            line-height: 30px;
        }
        .yjqmImg {
            width: 100px;
            height: 30px;
            padding-right: 20px;
        }
        .compSelectorHydd {
            div:first-child {
            width: 200px;
            }
        }
        .comp-select-box-hys-ksdw {
            .ant-checkbox-group-item {
                width: 180px !important;
                margin: 0px !important;
                padding-bottom: 5px;
                text-align: left;
                font-weight: 100;
            }
        }
        .ant-collapse-header {
            width: 100% !important;
        }
        .ant-collapse-extra {
            position: unset;
        }
    }
    .container {
        transition: flex 0.3s ease; /* 添加过渡效果使布局变化更平滑 */
        background-color: unset;
        .left-panel {
            // background-color: #f0f0f0; /* 可选：添加背景色以区分左右面板 */
            height: 100%; /* 示例高度，你可以根据需要调整 */
            /* 使用flex属性来控制左边面板的伸缩性 */
            flex-grow: 1; /* 当右边面板显示时，左边面板占据剩余空间 */
            flex-shrink: 1; /* 当右边面板隐藏时，左边面板可以缩小 */
            flex-basis: 100%; /* 初始基础大小设置为100% */
            overflow-y: auto;
        }
        .right-panel {
            padding: 5px 10px;
            width: 303px; /* 右边面板的宽度 */
            // background-color: #ddd; /* 可选：添加背景色以区分左右面板 */
            background-color: #f0f2f5;
            height: 100%; /* 示例高度，与左边面板保持一致 */
            display: block;
            align-items: center;
            justify-content: center;
            .right-panel-title {
                background-color: rgb(102, 194, 79);
                text-align: center;
                font-family: '宋体' !important;
                font-weight: bold;
                margin-top: 0.5em;
                color: white;
                border: 1px solid #e4e3e3;
                border-radius: 50px;
                padding: 5px;
            }
            .ant-list-split .ant-list-item {
                border-bottom: 1px solid #b2afaf;
            }
        }
        .right-panel button {
            /* 按钮样式 */
        }
    }
}
</style>
